package com.prs.crm.domain.pm;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Lob;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.Cascade;

import com.prs.crm.domain.Attachment;
import com.prs.crm.domain.BaseEntity;
import com.prs.crm.domain.doc.DocLevel;
import com.prs.crm.domain.doc.DocType;
import com.prs.crm.domain.oa.OaTask;

@Entity
@Table(name="pm_doc")
public class PmDoc extends BaseEntity{
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	private Integer id;
	private String name;
	@ManyToOne
	private DocType type;
	@ManyToOne(fetch=FetchType.LAZY)
	@Cascade({org.hibernate.annotations.CascadeType.ALL,org.hibernate.annotations.CascadeType.DELETE_ORPHAN})
	private Attachment attach;
	@Lob
	private String summary;
	@ManyToOne
	private PmProject project;
	@ManyToOne
	private PmStage stage;
	@ManyToOne
	private OaTask oaTask;
	private String state;
	private String code;
	@ManyToOne
	private DocLevel level;
	
	public Integer getId() {
		return id;
	}
	public void setId(Integer id) {
		this.id = id;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public DocType getType() {
		return type;
	}
	public void setType(DocType type) {
		this.type = type;
	}
	public Attachment getAttach() {
		return attach;
	}
	public void setAttach(Attachment attach) {
		this.attach = attach;
	}
	public String getSummary() {
		return summary;
	}
	public void setSummary(String summary) {
		this.summary = summary;
	}
	public PmProject getProject() {
		return project;
	}
	public void setProject(PmProject project) {
		this.project = project;
	}
	public PmStage getStage() {
		return stage;
	}
	public void setStage(PmStage stage) {
		this.stage = stage;
	}
	public void setState(String state) {
		this.state = state;
	}
	public String getState() {
		return state;
	}
	public void setCode(String code) {
		this.code = code;
	}
	public String getCode() {
		return code;
	}
	public void setLevel(DocLevel level) {
		this.level = level;
	}
	public DocLevel getLevel() {
		return level;
	}
	public void setOaTask(OaTask oaTask) {
		this.oaTask = oaTask;
	}
	public OaTask getOaTask() {
		return oaTask;
	}
	
}
